/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 *
 * @author ariel
 */
@Entity
@Table(name = "model_sizes")
public class ModelSize implements Serializable {

    private static final long serialVersionUID = 1L;

    
    private Long id;
    private String valueSize;
    private String description;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Column(name = "id_model_size", unique = true, nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ModelSize)) {
            return false;
        }
        ModelSize other = (ModelSize) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return new ToStringBuilder( this, ToStringStyle.SIMPLE_STYLE).append(this.getId())
                                  .append(this.valueSize).append(this.description)
                                  .toString();
    }

    /**
     * @return the valueSize
     */
    @Column(name = "value_size", unique = true, length = 10)
    public String getValueSize() {
        return valueSize;
    }

    /**
     * @param valueSize the valueSize to set
     */
    public void setValueSize(String valueSize) {
        this.valueSize = valueSize;
    }

    /**
     * @return the description
     */
    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

}
